export function trim (str) {
  return str.replace(/(^\s*)|(\s*$)/g, '')
}

export function ltrim (str) {
  return str.replace(/(^\s*)/g, '')
}

export function rtrim (str) {
  return str.replace(/(\s*$)/g, '')
}

export function schooltime (str) {
  let reg = /^[1-2][0|9]\d{2}-[0|1]\d{1}-[0|1|2|3]\d{1}\s/
  let arr = str.split(' - ')
  if (arr[0]) {
    return arr[0] + ' - ' + arr[1].replace(reg, '')
  } else {
    return str
  }
}
